package com.sskj.trafficcontrol.service.impl;

import com.sskj.trafficcontrol.dao.TcNoticeInfoDAO;
import com.sskj.trafficcontrol.model.pojo.TcNoticeInfo;
import com.sskj.trafficcontrol.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : zhao kuo
 * @date : 2019/2/4 12:07
 * @description :
 */
@Service
public class NoticeServiceImpl implements NoticeService {

    @Autowired
    private TcNoticeInfoDAO tcNoticeInfoDAO;

    @Override
    public void insertNotice(TcNoticeInfo tcNoticeInfo) {
        tcNoticeInfoDAO.insertSelective(tcNoticeInfo);
    }

    @Override
    public List<TcNoticeInfo> selectByTime() {
        return tcNoticeInfoDAO.selectByTime(null);
    }

    @Override
    public List<TcNoticeInfo> fetchAllNoticeInfos() {
        return tcNoticeInfoDAO.selectByPrimaryKey(null);
    }

    @Override
    public TcNoticeInfo selectFormIdIsNull(String open_id) {
        return tcNoticeInfoDAO.selectFormIdIsNull(open_id);
    }

    @Override
    public TcNoticeInfo selectFormIdIsExists(String open_id) {
        return tcNoticeInfoDAO.selectFormIdIsExists(open_id);
    }

    @Override
    public void updateNotice(TcNoticeInfo tcNoticeInfo) {
         tcNoticeInfoDAO.updateNotice(tcNoticeInfo);
    }

    @Override
    public Integer selectTotalCount(String open_id) {
        return tcNoticeInfoDAO.selectTotalCount(open_id);
    }

    @Override
    public void updateNoticeStatus(String open_id, String is_open) {
        tcNoticeInfoDAO.updateNoticeStatus(open_id,is_open);
    }

    @Override
    public void updateNoticeCount(TcNoticeInfo info) {
        tcNoticeInfoDAO.updateNoticeCount(info);
    }

    @Override
    public void updateNotices(TcNoticeInfo tcNoticeInfo) {
        tcNoticeInfoDAO.updateNotices(tcNoticeInfo);
    }

    @Override
    public TcNoticeInfo zuijinshijian(String openId) {
        return tcNoticeInfoDAO.zuijinshijian(openId);
    }

    @Override
    public void updateNoticeform(TcNoticeInfo tcNoticeInfo) {
         tcNoticeInfoDAO.updateNoticeform(tcNoticeInfo);
    }
}
